package com.common.enums.error;

import com.core.enums.CoreEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: stefanie-zy
 * @time: 2024/1/27-10:51
 * @description: Enum-异常枚举
 */
@Getter
@AllArgsConstructor
@Schema(name = "Enum-异常枚举")
public enum ResultEnum implements CoreEnum {

    SUCCESS(0, "success"),

    // 1-服务异常
    B_FAIL(10000, "service unknow error"),
    B_DUPLICATION_DATA(10001, "data duplicationCheck"),
    B_ICO_CREATE_ERROR(10002, "the user profile ico is generated incorrectly"),
    D_FAIL(11000, "database unknow error"),

    // 2-工具类异常
    U_FAIL(20000, "tool class unknow error"),
    U_GREP_ERROR(20001, "regular expression error"),

    // 3-参数异常
    P_CHECK_ERROR(30000, "params unknow error"),

    // 4-身份异常
    P_FAIL(40000, "permission denied"),

    // 5-系统错误
    S_FAIL(50000, "system error"),
    N_FAIL(51000, "network unknow error"),
    ;

    private final Integer code;
    private final String message;
}
